public class TowersOfHanoi_tryggve {

	private int totalDisks;
	int antFlyttinger=0;

	public TowersOfHanoi_tryggve(int disks) {
		totalDisks = disks;
	}

	public void solve() {
		moveTower(totalDisks, 1, 3, 2);
	}

	private void moveTower(int numDisks, int start, int end, int temp) {
		if (numDisks == 1)
			moveOneDisk(start, end);

		else {
			moveTower(numDisks - 1, start, temp, end);
			moveOneDisk(start, end);
			moveTower(numDisks - 1, temp, end, start);
		}
		
	}

	private void moveOneDisk(int start, int end) {
		antFlyttinger++;
		
	}
	public int hentAntallFlyttinger(){
		return antFlyttinger;
	}
}
